package com.ruoyi.system.callback;

import com.ruoyi.generator.annocation.MqttCallbackKey;
import com.ruoyi.generator.callback.MqttCallbackObserver;
import lombok.extern.slf4j.Slf4j;
import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken;
import org.eclipse.paho.client.mqttv3.MqttMessage;
import org.springframework.stereotype.Component;

@Component
@MqttCallbackKey("11111")
@Slf4j
public class BaseMqttCallBack extends MqttCallbackObserver {
    @Override
    public void connectComplete(boolean reconnect, String serverURI) {
        log.info("connectComplete , {}",serverURI);
    }

    @Override
    public void connectionLost(Throwable cause) {

    }

    @Override
    public void messageArrived(String topic, MqttMessage message) throws Exception {
        log.info("messageArrived , {} {} ",topic,message);
    }

    @Override
    public void deliveryComplete(IMqttDeliveryToken token) {
        log.info("deliveryComplete , {} ",token);
    }
}
